<?php
declare (strict_types = 1);

namespace app\model;

use think\facade\Log;
use think\Model;

/**
 * @property bool $reght 采纳:0=否,1=是
 * @property bool $type 回复类型:0=图文回复,1=视频回复
 * @property int $agree 赞同数量
 * @property int $bot 机器人:0=否,1=是
 * @property int $collect 收藏数量
 * @property int $comment 评论数量
 * @property int $id
 * @property int $like 点赞数量
 * @property int $question_id
 * @property int $users_id
 * @property string $content 回复内容
 * @property string $createtime
 * @property string $images 图片
 * @property string $updatetime
 * @property string $video_files 视频
 * @property-read \app\model\Question $question
 * @property-read \app\model\QuestionAnswerComment[] $comments
 * @property-read \app\model\Users $users
 * @property-read \app\model\UsersAgree $users_agree
 * @property-read \app\model\UsersCollect $users_collect
 * @property-read \app\model\UsersLike $users_like
 * @mixin \think\Model
 */
class QuestionAnswer extends Model
{
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    public function users()
    {
        return $this->belongsTo(Users::class, 'users_id');
    }

    public function usersCollect()
    {
        return $this->hasOne(UsersCollect::class,'pro_id');

    }

    public function usersLike()
    {
        return $this->hasOne(UsersLike::class,'pro_id');

    }

    public function usersAgree()
    {
        return $this->hasOne(UsersAgree::class,'pro_id');
    }

    function comments()
    {
        return $this->hasMany(QuestionAnswerComment::class,'answer_id');
    }


    function question()
    {
        return $this->belongsTo(Question::class,'question_id');
    }




}
